package myproject.CarRentalSystem;

public class Bus extends Car {
    private int seat;

    public Bus() {
    }

    public Bus(int seat) {
        this.seat = seat;
    }

    public Bus(String brand, int dayOfMoney, String plate, boolean state, int seat) {
        super(brand, dayOfMoney, plate, state);
        this.seat = seat;
    }

    public int getSeat() {
        return seat;
    }

    public void setSeat(int seat) {
        this.seat = seat;
    }

    @Override
    public String toString() {

        return "客车  " +
                getBrand() + "  " +
                seat + "座  " +
                getPlate() + "  " +
                getDayOfMoney() + "元  " +
                (getState() ? "已租用" : "可租用");
    }

    @Override
    public float rentMoney(int day) {
        if (day < 3) {
            return getDayOfMoney() * day * 1.0f;
        } else if (day < 7) {
            return getDayOfMoney() * day * 0.9f;

        } else if (day < 30) {
            return getDayOfMoney() * day * 0.8f;

        } else if (day < 150) {
            return getDayOfMoney() * day * 0.7f;

        } else {
            return getDayOfMoney() * day * 0.6f;
        }
    }
}
